export const generateOrderedArray = (n) => {
    const arr = []
    for (let i = 0; i < n; i++) {
        arr.push(n)
    }
    return arr
}

export const generateRandomArray = (n, bound = 100) => {
    const arr = []
    for (let i = 0; i < n; i++) {
        const num = Math.floor(Math.random() * bound)
        arr.push(num)
    }

    return arr
}

export const checkIsSorted = (arr) => {
    for (let i = 1; i < arr.length; i++) {
        if (arr[i - 1] > arr[i]) {
            return false
        }
    }
    return true
}

export const checkIsSortedR = (arr) => {
    for (let i = 1; i < arr.length; i++) {
        if (arr[i - 1] < arr[i]) {
            return false
        }
    }
    return true
}